package com.qianfeng.dbsm.common;

import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * 系统常量类
 */
@Getter
@Setter
public class Contants {

    public static final String ORDERPRESTR = "00001";

    public static final Integer AUDIT_STATUS_NO_AUDIT = 0;//分润-待审核

    public static final Integer AUDIT_STATUS_AUDITED_PASS = 1;//分润-已审核通过

    public static final Integer AUDIT_STATUS_AUDITED_NO_PASS = 2;//分润-审核不通过

    public static final Integer AUDIT_ROLE_ID = 6;//当前系统审核人员角色id

    /**
     * 订单状态枚举数据类型
     */
    public enum OrderStatusCode{

        CREATED_NOT_PAID(1,"创建未支付"),
        CREATED_PAID(2,"创建已支付"),
        PAID_NOT_DELIVER(3,"未发货"),
        DELIVERED_NOT_RECEIVE(4,"未签收"),
        RECEIVED_NO_COMMENT(5,"未评价"),
        COMMENTED(6,"已评价"),
        CANCELED(7,"已取消");
        private Integer code;
        private String message;

        public static String valueOf(Integer code) {
            if (code == null) return "";
            for (OrderStatusCode type : OrderStatusCode.values()) {
                if (Objects.equals(type.getCode(), code)) {
                    return type.getMessage();
                }
            }
            return "";
        }

        OrderStatusCode(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    };

    /**
     * 订单支付方式
     */
    public enum PayTypeCode{

        ALIPAY(1,"支付宝"),
        WXPAY(2,"微信"),
        BANKPAY(3,"网银"),
        YUNSHANFU(4,"云闪付");

        private Integer code;
        private String message;

        public static String valueOf(Integer code) {
            if (code == null) return "";
            for (OrderStatusCode type : OrderStatusCode.values()) {
                if (Objects.equals(type.getCode(), code)) {
                    return type.getMessage();
                }
            }
            return "";
        }

        PayTypeCode(Integer code, String message) {
            this.code = code;
            this.message = message;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    };

}

